home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000174_icon-group-sender _Mon Aug 31 09:30:47 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id JAA01134
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 31 Aug 1998 09:30:45 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA20152; Mon, 31 Aug 1998 09:30:17 -0700
Date: Mon, 31 Aug 1998 09:23:41 -0700
From: kwalker@sfo.harbinger.com (Ken Walker)
Message-Id: <199808311623.JAA20603@varda.premenos.com>
To: icon-group@optima.CS.Arizona.EDU
Subject: Re: A hood fan is guard to mind.
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Md5: 5qDOZPLcfV6WSo1n3qDQDQ==
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Content-Transfer-Encoding: 7bit
Status: RO
Content-Length: 1450
And here's a solution that does not involve passing "sentence" down
the call chain.
procedure main()
local fillers, firstChar, remainingChars
#
# The sentence is broken into three categories:
# parts not participating in the substitution
# the initial characters of the words involved in substitution
# the tail of the words involved in substitution
#
fillers := ["A ", " ", " is ", " to ", "."]
firstChar := ["g", "m", "h", "f"]
remainingChars := ["ood", "an", "ard", "ind"]
every write(polyspoonerism(fillers, firstChar, remainingChars))
end
procedure polyspoonerism(
fillers, # words before each participating word
firstChar, # first characters to use in substitutions
remainingChars) # words (w/out 1st char) that are participating
local indx
if *remainingChars = 0 then
return fillers[1] | ""
#
# Use each of the remaining first characters
#
every indx := 1 to *firstChar do {
#
# Construct the first part of the sentence then make a
# recursive call to construct the rest.
#
suspend fillers[1] || firstChar[indx] || remainingChars[1] ||
polyspoonerism(fillers[2:0], firstChar[1:indx] ||| firstChar[indx+1:0],
remainingChars[2:0])
}
end
This is finally starting to look reasonably elegant and Iconish.
Ken Walker, kenneth.walker@sfo.harbinger.com
Harbinger Coporation, Concord, Ca. 94520